#include "HeartBestcmd.h"

HeartBestCmd::HeartBestCmd(QObject *parent) :
    BaseCmd(parent)
{
    this->m_protocolType = ProtocolType::CloudProtocol;
    this->m_functionCode = FunctionCode;
}


Package HeartBestCmd::toPackage()
{
    Package package;
    return package;
}

void HeartBestCmd::unPackage(Package package)
{
    m_Type = package.body().mid(0,2).toHex().toInt(0,16);
    m_EquipmentID = package.body().mid(2,2).toHex().toInt(0,16);
    quint16 macLength=package.body().mid(8,2).toHex().toInt(0,16);
    m_Mac=package.body().mid(10,macLength);
    quint16 programNumlength=package.body().mid(10+macLength,2).toHex().toInt(0,16);
    m_ProgramNum=package.body().mid(12+macLength,programNumlength);
    m_body=package.body();
}
quint16 HeartBestCmd::Typenum() const
{
    return m_Type;
}

QByteArray HeartBestCmd::Errornum()const
{
    return m_ErrorNum;
}
quint16 HeartBestCmd::EquimentID()const
{
    return m_EquipmentID;
}
QByteArray HeartBestCmd::MAC()const
{
    return m_Mac;
}
QByteArray HeartBestCmd::ProgramNum()const
{
    return m_ProgramNum;
}

QByteArray HeartBestCmd::BODY()const
{
    return m_body;
}
void HeartBestCmd::SetErrornum(QByteArray errornum)
{
    m_ErrorNum=errornum;
}

void HeartBestCmd::SetID(const quint16 &EquipmentID)
{
    m_EquipmentID=EquipmentID;
}

void HeartBestCmd::SetMAC(QByteArray MAC)
{
    m_Mac=MAC;
}
void HeartBestCmd::SetProgramNum(QByteArray programNum)
{
    m_ProgramNum=programNum;
}

void HeartBestCmd::SetTypenum(const quint16 &Type)
{
    m_Type=Type;
}


void HeartBestData::SetID(const quint16 &ID)
{
    m_EquipmentID=ID;
}

void HeartBestData::SetErrornum(QByteArray Errornum)
{
    m_ErrorNum=Errornum;
}
void HeartBestData::SetMAC(QByteArray MAC)
{
    m_Mac=MAC;
}
void HeartBestData::SetProgramNum(QByteArray ProgramNum)
{
    m_ProgramNum=ProgramNum;
}
void HeartBestData::SetTypenum(const quint16 &Typenum)
{
    m_Type=Typenum;
}
quint16 HeartBestData::EquimentID() const
{
    return m_EquipmentID;
}
QByteArray HeartBestData::MAC() const
{
    return m_Mac;
}
HeartBestList* HeartBestList::m_pInstancelist=NULL;
